<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateOpenShopContractTemplate extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('open_shop_contract_template', function (Blueprint $table) {
            $table->id();

            $table->string('templateName')->default('')->comment('模版名称');
            $table->unsignedTinyInteger('year')->default(0)->comment('合同年限');
            $table->unsignedInteger('initialFee')->default(0)->comment('加盟费');
            $table->unsignedInteger('technologyTransferFee')->default(0)->comment('技术转让费');
            $table->unsignedInteger('deposit')->default(0)->comment('保证金');
            $table->unsignedInteger('managementCost')->default(0)->comment('特许权使用费第一年');
            $table->unsignedInteger('decorationDeposit')->default(0)->comment('装修保证金');
            $table->tinyInteger('shopCount')->default(0)->comment('店铺数量');

            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('createdByUid')->default(0)->comment('创建人');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->unsignedInteger('updatedByUid')->default(0)->comment('修改人');

            $table->collation = 'utf8mb4_general_ci';
            $table->comment = '招商加盟 - 合同模版';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('open_shop_contract_template');
    }
}
